package com.itheima.service;

import com.itheima.dao.PersonDao;
import com.itheima.domain.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PersonService {
    @Autowired
    private PersonDao persondao;

    public Person getByID( int id ) {
        return persondao.getById(id);
    }

    public List<Person> getAll() {
        return persondao.getAll();
    }

    public int update( Person person) {
        int update = persondao.update(person);
        return update;
    }

    public int insert(Person person) {
        int insert = persondao.insert(person);
        return insert;
    }
    public int delete(int id) {
        int delete =persondao.delete(id);
        return delete;
    }
}
